function EditMailGui(prefix, container, item, options) {
  this._prefix = prefix;
  this._container = container;
  this._item = item;

  this._createElements();
}

EditMailGui.prototype._createElements = function() {
  var table, tr, td, img, input, _self = this;
  
  DOMUtils.removeChildElements(this._container);
  table = document.createElement('table');
  table.style.width = '880px';
  table.style.height = '500px';
  table.cellPadding = 0;
  table.cellSpacing = 0;
  this._container.appendChild(table);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.colSpan = 2;
  td.style.height = '100px';
  td.style.textAlign = 'center';
  td.style.verticalAlign = 'middle';
  var sent = document.createElement('img');
  sent.src = 'images/pagecommon/pageb1send/sent.png';
  sent.id = 'img' + this._prefix + '1';
  td.appendChild(sent);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.align = 'left';
  td.style.width = '440px';
  td.style.height = '30px';
  td.style.verticalAlign = 'bottom';
  var sent1 = document.createElement('img');
  sent1.src = 'images/pagecommon/pageb1send/sent1.png';
  sent1.style.margin = '0 0 3px 0';
  td.appendChild(sent1);
  td = tr.insertCell(-1);
  td.align = 'left';
  td.style.verticalAlign = 'bottom';
  td.style.width = '440px';
  var sent2 = document.createElement('img');
  sent2.src = 'images/pagecommon/pageb1send/sent2.png';
  sent2.style.margin = '0 0 3px 0';
  td.appendChild(sent2);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.align = 'left';
  td.style.height = '50px';
  td.style.verticalAlign = 'top';
  input = DOMUtils.createInput(null, 'input' + this._prefix + '1', 'text', '', null);
  input.style.width = '200px';
  input.style.height = '29px';
  input.style.border = 'solid 1px #989ca5';
  td.appendChild(input);
  
  td = tr.insertCell(-1);
  td.align = 'left';
  td.style.verticalAlign = 'top';
  input = DOMUtils.createInput(null, 'input' + this._prefix + '2', 'text', this._item.number, null);
  input.style.width = '200px';
  input.style.height = '29px';
  input.style.border = 'solid 1px #989ca5';
  td.appendChild(input);
  
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.align = 'left';
  td.style.width = '440px';
  td.style.height = '30px';
  td.style.verticalAlign = 'bottom';
  var sent3 = document.createElement('img');
  sent3.src = 'images/pagecommon/pageb1send/sent3.png';
  sent3.style.margin = '0 0 3px 0';
  td.appendChild(sent3);
  td = tr.insertCell(-1);
  td.align = 'left';
  td.style.width = '440px';
  td.style.verticalAlign = 'bottom';
  var sent4 = document.createElement('img');
  sent4.src = 'images/pagecommon/pageb1send/sent4.png';
  sent4.style.margin = '0 0 3px 0';
  td.appendChild(sent4);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.align = 'left';
  td.style.height = '50px';
  td.style.verticalAlign = 'top';
  input = DOMUtils.createInput(null, 'input' + this._prefix + '3', 'text', this._item.company, null);
  input.style.width = '200px';
  input.style.height = '29px';
  input.style.border = 'solid 1px #989ca5';
  td.appendChild(input);
  
  td = tr.insertCell(-1);
  td.align = 'left';
  td.style.verticalAlign = 'top';
  input = DOMUtils.createInput(null, 'input' + this._prefix + '4', 'text', this._item.weight, null);
  input.style.width = '200px';
  input.style.height = '29px';
  input.style.border = 'solid 1px #989ca5';
  td.appendChild(input);
  var g = document.createElement('img');
  g.src = 'images/pagecommon/pageb1send/g.png';
  g.style.margin = '0 0 0 10px';
  td.appendChild(g);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.align = 'left';
  td.style.width = '440px';
  td.style.height = '30px';
  td.style.verticalAlign = 'bottom';
  var sent5 = document.createElement('img');
  sent5.src = 'images/pagecommon/pageb1send/sent5.png';
  sent5.style.margin = '0 0 3px 0';
  td.appendChild(sent5);
  td = tr.insertCell(-1);
  td.align = 'left';
  td.style.width = '440px';
  td.style.verticalAlign = 'bottom';
  var sent6 = document.createElement('img');
  sent6.src = 'images/pagecommon/pageb1send/sent6.png';
  sent6.style.margin = '0 0 3px 0';
  td.appendChild(sent6);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.align = 'left';
  td.style.height = '50px';
  td.style.verticalAlign = 'top';
  input = DOMUtils.createInput(null, 'input' + this._prefix + '5', 'text', '', null);
  input.style.width = '200px';
  input.style.height = '29px';
  input.style.border = 'solid 1px #989ca5';
  td.appendChild(input);
  
  td = tr.insertCell(-1);
  td.align = 'left';
  td.style.height = '50px';
  td.style.verticalAlign = 'top';
  input = DOMUtils.createInput(null, 'input' + this._prefix + '6', 'text', this._item.recipient, null);
  input.style.width = '200px';
  input.style.height = '29px';
  input.style.border = 'solid 1px #989ca5';
  td.appendChild(input);
  
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.align = 'left';
  td.colSpan = 2;
  td.style.width = '440px';
  td.style.height = '30px';
  td.style.verticalAlign = 'bottom';
  var des = document.createElement('img');
  des.src = 'images/pagecommon/pageb1send/sent7.png';
  des.style.margin = '0 0 3px 0';
  td.appendChild(des);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.align = 'left';
  td.colSpan = 2;
  td.style.height = '50px';
  td.style.verticalAlign = 'top';
  input = DOMUtils.createInput(null, 'input' + this._prefix + '7', 'text', this._item.destination, null);
  input.style.width = '600px';
  input.style.height = '29px';
  input.style.border = 'solid 1px #989ca5';
  td.appendChild(input);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.align = 'left';
  td.colSpan = 2;
  td.style.height = '30px';
  td.style.verticalAlign = 'bottom';
  var note = document.createElement('img');
  note.src = 'images/pagecommon/pageb1send/sent8.png';
  note.style.margin = '0 0 3px 0';
  td.appendChild(note);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.align = 'left';
  td.colSpan = 2;
  td.style.verticalAlign = 'top';
  var com = document.createElement('textarea');
  com.style.width = '600px';
  com.style.height = '120px';
  com.style.border = 'solid 1px #989ca5';
  com.id = 'input' + this._prefix + '8';
  com.value = this._item.comment;
  td.appendChild(com);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.appendChild(document.createTextNode('Products'));
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.colSpan = 2;
  var itable, itr, itd;
  itable = document.createElement('table');
  td.appendChild(itable);
  
  itr = itable.insertRow(-1);
  itd = itr.insertCell(-1);
  itd.style.width = '400px';
  itd.appendChild(document.createTextNode('Product'));
  itd = itr.insertCell(-1);
  itd.style.width = '200px';
  itd.appendChild(document.createTextNode('Quantity'));
  for (var i = 0, il = this._item.produces.length; i < il; i++) {
    var produce = this._item.produces[i];
    
    itr = itable.insertRow(-1);
    itd = itr.insertCell(-1);
    itd.appendChild(document.createTextNode(produce.product.name));
    itd = itr.insertCell(-1);
    itd.appendChild(document.createTextNode(produce.quantity));
  }
};